<script type="text/javascript" src="util.js"></script>
<script type="text/javascript" src="like_dislike_system.js"></script>
<script type="text/javascript" src="comment.js"></script>

<ul id="menu">
<li><a href="Index">Home</a></li>
<li><a href="ContentList">Content List</a></li>

<c:choose>
	<c:when test="${not empty sessionScope.username}">
	  <li><a href="Post">Post</a></li>
	  <li>
	    Welcome <a href="Profile?username=${sessionScope.username}">${sessionScope.username}</a>
	  </li>
	  <li>
	    <script type="text/javascript">
	      document.writeln('<img src="/snsdbook/avatar/' + GetAvatarOf("${sessionScope.username}") + '" width="42" height="42"/>');
	    </script>
	  </li>
	  <li><a href="LogOut">Log Out</a></li>
	</c:when>
	<c:otherwise>
    <li><a href="Register">Register</a></li>
    
    <li>
    <form action="Login" method="get" id="login_form">
	    <input type="text" name="username_field" id="username_field" />
      <input type="password" name="password_field" id="password_field" />
	  </form>
	  <button id="login_button" onclick="Login()">Login</button>
	  <p class="error" id="login_error"></p>
	  </li>
    
	</c:otherwise>
</c:choose>

<li>
  <form action="ContentList" method="get">
    <input type="text" name="search"/>
    <select name="search_where">
      <option value="all">All</option>
      <option value="user">Username</option>
      <option value="content">Content</option>
      <option value="title">Title</option>
      <option value="tag">Tag</option>
    </select>
    <input type="submit" value="Search"/>
  </form>
</li>
</ul>
